class ApplicationController < ActionController::Base
  protect_from_forgery
  def after_sign_in_path_for(resource)
    if(session[:language] == "vi")
      homepage_path+"?lang=vi"
    else
      homepage_path
    end
  end
  def after_sign_out_path_for(resource)
     if(session[:language] == "vi")
      homepage_path+"?lang=vi"
    else
      homepage_path
    end
  end
  
  before_filter :set_locale
  def set_locale
    I18n.locale = params[:lang] if params[:lang].present?
  end
end
